package com.comcast.util;

import java.net.InetAddress;

/**
 * This class gets and stores the physical host name and WLS managed server name so
 * that it can be shared by other classes.
 *
 * @author Charles Zhao
 */
public class ServerInfo {
	private static String physicalHostName;
	private static String wlsServerName;

	static {
		try {
			physicalHostName = InetAddress.getLocalHost().getHostName().replace(".cable.comcast.com", "");
		} catch (Exception e) {
			physicalHostName = "UnknownHost";
		}
		wlsServerName = System.getProperty("weblogic.Name", "UnknownServer");
	}

	public static String getPhysicalHostName() {
		return physicalHostName;
	}

	public static String getWlsServerName() {
		return wlsServerName;
	}
}
